*** Settings ***
Documentation  发帖相关
Library  SeleniumLibrary

*** keywords ***
用户发帖    #标题 内容
    [Arguments]     ${title}    ${text}
    Click Element   xpath://*[@id="tab-value"]
    Click Element   xpath://option[@value="share"]
    Input Text      xpath://*[@id="title"]      ${title}
    Click Element   xpath://div[@class="CodeMirror-scroll"]
    SetFocus To Element    xpath://div[@class="CodeMirror-scroll"]
    press keys      xpath://div[@class="CodeMirror-scroll"]   ${text}
    Click Element   xpath://*[@type="submit"]
    ${url}      Log location
    [Return]    ${url}

验证发帖
    [Arguments]     ${title}    ${text}
    Element Text Should Be      //*[@class="topic_full_title"]      ${title}
    Element Should Contain      //div[@class="changes"]/span[last()]    分享
    Element Should Contain      //div[@class="topic_content"]/div[@class="markdown-text"]   ${text}

删除发帖
    Click Element       xpath://*[@title="删除"]
    Handle Alert
    [Return]    Log Location

验证删除
    Element Text Should Be  //strong    此话题不存在或已被删除。